<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>过渡</title>
    <style>

        .a {
            width: 150px;
            height: 10px;
            border: 1px solid red;
            border-radius: 5px;
        }

        .b {
            width: 50%;
            height: 100%;
            border-radius: 5px;
            background-color: red;
            transition: width .5s;
        }

        .a:hover .b {
            width: 100%;
        }
    /**/
    </style>
</head>
<body>
<!---->
<div class="a">
    <div class="b"></div>
</div>
</body>
</html>